import { createAxios } from '@/utils/http/axios';

enum Api {
  getVerBySn = '/virtual/iotVirtualDeviceModule/getVerBySn',
}

export interface GetVerBySnRes {
  deviceId: number;
  iotAppVer: string;
  iotOsVer: string;
  dspBackVer: string;
  dspFrontVer: string;
  armVer: string;
}

export function getVerBySnApi(data: { sn: string }): Promise<GetVerBySnRes> {
  return createAxios({
    requestOptions: {
      apiUrl: '/hc-api',
    },
  }).post({
    url: Api.getVerBySn,
    data: data,
  });
}
